<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
      
<h:head>
	<title>Modifica Hotel</title>
	<link href="resources/css/main.css" rel="stylesheet" type="text/css" />
</h:head>  
<h:body>
<header>
		<a><h:link class="logo" outcome="index" /></a>
	</header>
	<div id="container">
		<div id="content1">
			<div id="contentLarge">
	
	<h:form id="form" onsubmit="#{beanProdottoBase.retrieveHotel()}">
		
		<p:growl id="messages" showDetail="true"/>
		
		<p:dataTable id="dataTableHotel" var="hotel" value="#{beanProdottoBase.listaHotel}" widgetVar="hotelTable"   
		            emptyMessage="Nessun hotel trovato per i parametri specificati." rowKey="#{hotel.codice}"
		            editable="true" filteredValue="#{Retriever.hotelFiltrati}">
		            
		            
		  		<f:facet name="header">
          			 Cerca, modifica ed elimina hotel
        		</f:facet> 
        		
        		<p:ajax event="rowEdit" listener="#{beanProdottoBase.updateHotel}" update=":form:messages" />  
       			<p:ajax event="rowEditCancel" listener="#{beanProdottoBase.deleteHotel}" update=":form:messages" />
		  
		  		
		  		
		        <p:column id="nomeHotel" filterBy="nome"   
		                headerText="Nome"
		                filterMatchMode="contains">  
		            <p:cellEditor>  
                		<f:facet name="output">  
                    		<h:outputText value="#{hotel.nome}" />  
                		</f:facet>  
                		<f:facet name="input">  
                    		<p:inputText value="#{hotel.nome}"/>
                		</f:facet>  
            		</p:cellEditor>  
		        </p:column>
		        
		  		 <p:column id="cittaHotel" filterBy="citta"   
		                headerText="Citta"
		                filterMatchMode="contains">  
		            <p:cellEditor>  
                		<f:facet name="output">  
                    		<h:outputText value="#{hotel.citta}" />  
                		</f:facet>  
                		<f:facet name="input">  
                    		<p:inputText value="#{hotel.citta}"/>
                		</f:facet>  
            		</p:cellEditor>  
		        </p:column> 
		        
		        <p:column id="telefonoHotel" filterBy="telefono"   
		                headerText="Telefono"
		                filterMatchMode="contains">  
		            <p:cellEditor>  
                		<f:facet name="output">  
                    		<h:outputText value="#{hotel.telefono}" />  
                		</f:facet>  
                		<f:facet name="input">  
                    		<p:inputText value="#{hotel.telefono}"/>
                		</f:facet>  
            		</p:cellEditor>  
		        </p:column>
		        
		        <p:column id="stanze_DisponibiliHotel" filterBy="stanze_Disponibili"   
		                headerText="Stanze disponibili"
		                filterMatchMode="contains">  
		            <p:cellEditor>  
                		<f:facet name="output">  
                    		<h:outputText value="#{hotel.stanze_Disponibili}" />  
                		</f:facet>  
                		<f:facet name="input">  
                    		<p:inputText value="#{hotel.stanze_Disponibili}"/>
                		</f:facet>  
            		</p:cellEditor>  
		        </p:column>
		        
		        <p:column id="indirizzoHotel" filterBy="indirizzo"   
		                headerText="Indirizzo"
		                filterMatchMode="contains">  
		            <p:cellEditor>  
                		<f:facet name="output">  
                    		<h:outputText value="#{hotel.indirizzo}" />  
                		</f:facet>  
                		<f:facet name="input">  
                    		<p:inputText value="#{hotel.indirizzo}"/>
                		</f:facet>  
            		</p:cellEditor>  
		        </p:column>
		        
		        <p:column id="mailHotel" filterBy="mail"   
		                headerText="Mail"
		                filterMatchMode="contains">  
		            <p:cellEditor>  
                		<f:facet name="output">  
                    		<h:outputText value="#{hotel.mail}" />  
                		</f:facet>  
                		<f:facet name="input">  
                    		<p:inputText value="#{hotel.mail}"/>
                		</f:facet>  
            		</p:cellEditor>  
		        </p:column>
		        
		        <p:column id="n_StelleHotel" filterBy="n_Stelle"   
		                headerText="N Stelle"
		                filterMatchMode="contains">  
		            <p:cellEditor>  
                		<f:facet name="output">  
                    		<h:outputText value="#{hotel.n_Stelle}" />  
                		</f:facet>  
                		<f:facet name="input">  
                    		<p:inputText value="#{hotel.n_Stelle}"/>
                		</f:facet>  
            		</p:cellEditor>  
		        </p:column>
		        
		        <p:column id="prezzoHotel" filterBy="prezzo"   
		                headerText="Prezzo"
		                filterMatchMode="contains">  
		            <p:cellEditor>  
                		<f:facet name="output">  
                    		<h:outputText value="#{hotel.prezzo}" />  
                		</f:facet>  
                		<f:facet name="input">  
                    		<p:inputText value="#{hotel.prezzo}"/>
                		</f:facet>  
            		</p:cellEditor>  
		        </p:column>
		        
		        <p:column style="width:6%">  
           			<p:rowEditor />  
        		</p:column>
		          
		    </p:dataTable> 
	</h:form>
	</div>
	</div>
	<a><h:link class="button1" outcome="creaProdottoBase" value="Indietro"/></a>
	</div>
	<h:outputStylesheet library="css" name="main.css"/>
</h:body>
       
</html>